home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////
- //
- // UtilRouting.js
- //
- // Routing routine mapping for generic pages
- //
- // Copyright (c) 1999 MGI Software Corp. All Rights Reserved
- // <Script>
-
- function toggleDebug()
- {
- top.debugLevel = top.debugLevel ? 0 : 1;
- alert("Debug Level: "+top.debugLevel);
- }
-
- function debugalert(stralert)
- {
- if (top.debugLevel)
- alert(stralert);
- }
-
- function MenuExec(evalCode)
- {
- return top._RouteCall( "Liquid", evalCode );
- }
-
- function BrowserExec(evalCode)
- {
- return top._RouteCall( "Browser", evalCode );
- }
-
- function ActivatePhotoModule(ID)
- {
- // top.Browser.SetupBrowserView ('makeover') ;
- top._RouteCall( "Browser", "_ActivatePhotoModule('"+ID+"');" );
- }
-
- function ActivatePrintModule(ID)
- {
- top._RouteCall( "Browser", "_ActivatePrintModule('"+ID+"');" );
- }
-
- function ActivateLayoutModule(ID)
- {
- top._RouteCall( "Browser", "_ActivateLayoutModule('"+ID+"');" );
- }
-
- function ClickActivityButton(BtnID)
- {
- // Just Click it, don't Do Anything
- top._RouteCall( "ActivityList", "_ClickActivityButton('"+BtnID+"');" );
- //_ALUpdateButton(BtnID);
- }
-
- function SetCommandBar(str)
- {
- LTKTriggerEvent(str);
- }
-
- // Delete a routing (This will cascade up to StartPage.html)
- function DeleteRouting( Dest, FrameObject )
- {
- return top._DeleteRouting( Dest, FrameObject );
- }
-
- // Add a routing (This will cascade up to StartPage.html)
- function AddRouting( Dest, FrameObject, Dependants )
- {
- return top._AddRouting( Dest, FrameObject, Dependants );
- }
-
- // Route a function call (This will cascade up to StartPage.html)
- function RouteCall( Dest, EvalCode )
- {
- return top._RouteCall( Dest, EvalCode );
- }
-
- // Set Queueing mode (This will cascade up to StartPage.html)
- function SetQueueMode( Dest, Mode, Recurse )
- {
- return top._SetQueueMode( Dest, Mode, Recurse );
- }
-
- // Execute some code (called from StartPage.html)
- function EvalCode(MyCode)
- {
- if( MyCode != "" )
- {
- return eval(MyCode);
- }
- }
-
- ////////////////////////////////////////////////////////////////
- //
- // Simplified mappings
- //
-
- // Roots
-
- function GetLanguageFolder()
- {
- // This is a hack for speed!
- return top._GetLanguageFolder();
- // Proper call should be:
- // return top._RouteCall( "Root", "_GetLanguageFolder();" );
- }
-
- function SetConsoleMode( Expert )
- {
- // This is a hack for speed!
- return top._SetConsoleMode( Expert );
- // Proper call should be:
- // return top._RouteCall( "Root", "_SetConsoleMode("+Expert+");" );
- }
-
- // Liquid Toolkit (through proxies)
-
- function LTKTriggerEvent(driver)
- {
- return top._RouteCall( "Liquid", "_LTKTriggerEvent(\""+driver+"\");" );
- }
-
- function LTKDoHelp()
- {
- return top._RouteCall( "Liquid", "_LTKTriggerEvent('CommandDispatcher,Active,20140');" );
- }
-
- function LTKConnectToWorkflow(wkf)
- {
- return top._RouteCall( "Liquid", "_LTKConnectToWorkflow('"+wkf+"');" );
- }
-
- function LTKDisconnectFromWorkflow(wkf)
- {
- return top._RouteCall( "Liquid", "_LTKDisconnectFromWorkflow('"+wkf+"');" );
- }
-
- function LTKGetContext( Ctx )
- {
- return top._RouteCall( "Liquid", "_LTKGetContext("+Ctx+");" );
- }
-
- function isMapi()
- {
- return top._RouteCall( "Liquid", "_isMapi();" );
- }
-
- function isPrinters()
- {
- return top._RouteCall( "Liquid", "_isPrinters();" );
- }
-
- function LTKGetKeyValue( KeyName, ValueName, Default )
- {
- return top._RouteCall( "Liquid", "_LTKGetKeyValue('"+KeyName+"','"+ValueName+"','"+Default+"');" );
- }
-
- function LTKGetIntKeyValue( KeyName, ValueName, Default )
- {
- return top._RouteCall( "Liquid", "_LTKGetIntKeyValue('"+KeyName+"','"+ValueName+"','"+Default+"');" );
- }
-
- function LTKSetKeyValue( KeyName, ValueName, Value )
- {
- return top._RouteCall( "Liquid", "_LTKSetKeyValue('"+KeyName+"','"+ValueName+"','"+Value+"');" );
- }
-
- function LTKSetIntKeyValue( KeyName, ValueName, Value )
- {
- return top._RouteCall( "Liquid", "_LTKSetIntKeyValue('"+KeyName+"','"+ValueName+"','"+Value+"');" );
- }
-
- function LTKGetWorkflowValue( WkfName, WkfStep)
- {
- return top._RouteCall( "Liquid", "_LTKGetWorkflowValue('"+WkfName+"','"+WkfStep+"');" );
- }
-
- function LTKSetWorkflowValue( WkfName, WkfStep, Value)
- {
- return top._RouteCall( "Liquid", "_LTKSetWorkflowValue('"+WkfName+"','"+WkfStep+"','"+Value+"');" );
- }
-
- function LTKGetWorkflowMinValue( WkfName, WkfStep)
- {
- return top._RouteCall( "Liquid", "_LTKGetWorkflowMinValue('"+WkfName+"','"+WkfStep+"');" );
- }
-
- function LTKSetWorkflowMaxValue( WkfName, WkfStep, Value)
- {
- return top._RouteCall( "Liquid", "_LTKSetWorkflowMaxValue('"+WkfName+"','"+WkfStep+"','"+Value+"');" );
- }
-
- function LTKGetWorkflowStringArrLength( WkfName, WkfStep)
- {
- return top._RouteCall( "Liquid", "_LTKGetWorkflowStringArrLength('"+WkfName+"','"+WkfStep+"');" );
- }
-
- function LTKGetWorkflowStringArrItem( WkfName, WkfStep, Index )
- {
- return top._RouteCall( "Liquid", "_LTKGetWorkflowStringArrIteme('"+WkfName+"','"+WkfStep+"','"+Index+"');" );
- }
-
- function LTKSetWorkflowStringArrItem( WkfName, WkfStep, Index, Item )
- {
- return top._RouteCall( "Liquid", "_LTKGetWorkflowStringArrIteme('"+WkfName+"','"+WkfStep+"','"+Index+"','"+Item+"');" );
- }
-
- ////////////////////////////////////////////////////////////////
- //
- // String manipulation (All slashes are expected forward!)
- //
-
- // Resolve a relative path to a base path
- function ResolvePath( sBasePath, sRelativePath )
- {
- var sNewBasePath;
- var sNewEndPath;
-
- var nLevelBack = 1; // Fix for last backslash
- var nCurrIdx = 0;
-
- var nTemp;
-
- // Start by removing the filename from sBasePath if present
- sNewBasePath = sBasePath.substring(0, sBasePath.lastIndexOf("/")+1 );
-
- // Count the number of levels we must go back
- while(1)
- {
- nTemp = sRelativePath.indexOf( "../", nCurrIdx );
-
- if( nTemp >= 0 )
- {
- nCurrIdx = nTemp + 3; // "../".length;
- nLevelBack += 1;
- }
- else
- {
- break;
- }
- }
-
- sNewEndPath = sRelativePath.substring( nCurrIdx, sRelativePath.length );
-
- // Go back
- while( nLevelBack > 0 )
- {
- nTemp = sBasePath.lastIndexOf("/", sNewBasePath.length-1);
- sNewBasePath = sNewBasePath.substring( 0, nTemp );
- nLevelBack -= 1;
- }
-
- // Return the value
- return sNewBasePath + "/" + sNewEndPath;
- }
-
-
- ////////////////////////////////////////////////////////////////
- //
- // Miscelaneous stuff
- //
-
- function SmartJump( fTarget, sNewTarget )
- {
- return top._SmartJump(fTarget, sNewTarget );
- }
-
- // Absolute path version
- function SmartJumpAbs( fTarget, sNewTarget )
- {
- return top._SmartJumpAbs( fTarget, sNewTarget );
- }
-
-
- ////////////////////////////////////////////////////////////////
- //
- // Event Sink and dispatch
- //
-
- // Hook to event dispatch chain
- function AdviseSink( window )
- {
- return top._AdviseSink( window );
- }
-
- // Remove from event dispatch chain
- function UnadviseSink( window )
- {
- return top._UnadviseSink( window );
- }
-
- // Notify all
- function NotifySink( id, wparam, lparam )
- {
- return top._NotifySink( id, wparam, lparam );
- }
-
- // Note: frame calling AdviseSink MUST implement a function:
- //
- // function EventSinkImpl( id, wparam, lparam );
- //
- // If the function returns 0, event has been handled and all
- // further processing is canceled. If function return 1,
- // NotifySink will call next registered handler (in reverse order).
-
- function LTKSetContextHelp(nHelpID)
- {
- return top._RouteCall( "Liquid", "_LTKTriggerEvent('CommandDispatcher,Broadcast,20147,"+nHelpID+"');" );
- }
-